using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for Deliverable
/// </summary>
/// [System.ComponentModel.DataObject]
public class Deliverable : IBusinessEntity
{
    private int _deliverableID;
    private string _type;
    private string _serviceName;
    private float _weight;
    private string _distance;
    private int _customerID;
    private bool _status;
    private string _receiverName;
    private string _receiverAddress;
    private string _receiverCity;

    public Deliverable()
    {
    }

    public Deliverable(int deliverableID, string type, string serviceName, float weight, string distance, int customerID, bool status, string receiverName, string receiverAddress, string receiverCity)
    {
        _deliverableID = deliverableID;
        _type = type;
        _serviceName = serviceName;
        _weight = weight;
        _distance = distance;
        _customerID = customerID;
        _status = status;
        _receiverName = receiverName;
        _receiverAddress = receiverAddress;
        _receiverCity = receiverCity;
    }

    #region Properties
    public int DeliverableID
    {
        get { return _deliverableID; }
        set { _deliverableID = value; }
    }
    
    public string Type
    {
        get { return _type; }
        set { _type = value; }
    }

    public string ServiceName
    {
        get { return _serviceName; }
        set { _serviceName = value; }
    }

    public float Weight
    {
        get { return _weight; }
        set { _weight = value; }
    }

    public string Distance
    {
        get { return _distance; }
        set { _distance = value; }
    }

    public int CustomerID
    {
        get { return _customerID; }
        set { _customerID = value; }
    }
    
    public bool Status
    {
        get { return _status; }
        set { _status = value; }
    }

    public string ReceiverName
    {
        get { return _receiverName; }
        set { _receiverName = value; }
    }

    public string ReceiverAddress
    {
        get { return _receiverAddress; }
        set { _receiverAddress = value; }
    }
    
    public string ReceiverCity
    {
        get { return _receiverCity; }
        set { _receiverCity = value; }
    }
    #endregion

    #region IBusinessEntity Members

    public void Fill(System.Data.SqlClient.SqlDataReader reader)
    {
        _deliverableID = reader.GetInt32(0);
        _type = reader.GetString(1);
        _serviceName = reader.GetString(2);
        _weight = (float) reader.GetDouble(3);
        _distance = reader.GetString(4);
        _customerID = reader.GetInt32(5);
        _status = reader.GetBoolean(6);
        _receiverName = reader.GetString(7);
        _receiverAddress = reader.GetString(8);
        _receiverCity = reader.GetString(9);
    }

    #endregion
}
